import { BasicColumn } from "/@/components/Table";
import { GroupTypeEnum } from "/@/enums/typeEnum";

export const studentBasicColumns: BasicColumn[] = [
  {
    dataIndex: "userId",
    title: "用户主键",
    ifShow: false,
  },
  {
    dataIndex: "collegeId",
    title: "学院主键",
    ifShow: false,
  },
  {
    dataIndex: "userName",
    title: "姓名",
  },
  {
    dataIndex: "userCode",
    title: "学号",
  },
  {
    dataIndex: "collegeName",
    title: "所在学院",
    defaultHidden: true,
  },
];

export const teacherBasicColumns: BasicColumn[] = [
  {
    dataIndex: "userId",
    title: "用户主键",
    ifShow: false,
  },
  {
    dataIndex: "collegeId",
    title: "学院主键",
    ifShow: false,
  },
  {
    dataIndex: "userName",
    title: "姓名",
  },
  {
    dataIndex: "userCode",
    title: "工号",
  },
  {
    dataIndex: "collegeName",
    title: "所在学院",
  },
];

export const groupBasicColumns: BasicColumn[] = [
  {
    title: "小组主键",
    dataIndex: "groupId",
    ifShow: false,
  },
  {
    title: "小组名称",
    dataIndex: "groupName",
  },
  {
    title: "小组人数",
    dataIndex: "total",
  },
  {
    title: "可选人数",
    dataIndex: "stock",
    sorter: true,
  },
  {
    dataIndex: "type",
    title: "小组类型",
    customRender: ({ text }) => {
      switch (text) {
        case GroupTypeEnum.DEFAULT:
          return "普通小组";
        case GroupTypeEnum.PRACTICAL:
          return "实习小组";
        default:
          return "非法类型";
      }
    },
  },
];
